<?php
/**
 * 版本:酷享云支付3.0版
 * 作者：余生
 * 官网：www.kuxiangcms.com
 * 技术QQ：2316803263
 * 酷享云支付官网:pay.kuxiangcms.cn
**/
//管理员修改
include("../includes/common.php");
include './head.php';
$my=isset($_GET['my'])?$_GET['my']:null;
if ($islogin == 1) {
} else {
  exit("<script language='javascript'>window.location.href='./login.php';</script>");
}
?>

<?php 
if(isset($_POST['submit'])) {
    foreach ($_POST as $k => $value) {
        if($k=='admin_pwd')continue;
        $value=daddslashes($value);
        $DB->query("insert into pay_config set `k`='{$k}',`v`='{$value}' on duplicate key update `v`='{$value}'");
    }
    if(!empty($_POST['admin_pwd'])){
        $pwd =  md5($_POST['admin_pwd'].$password_hash."admin");
        $DB->query("update `pay_config` set `v` ='{$pwd}' where `k`='admin_pwd'");
    }
     
    exit("<script language='javascript'>alert('修改成功！');window.location.href='./user.php';</script>");
}
if($my == "glj"){
?>

<?php
}elseif($my == "admin"){
    ?>

     <div class="layui-fluid">
            <div class="layui-row">
             <form action="" method="post" class="layui-form">
                  <div class="layui-form-item">
                      <label for="username" class="layui-form-label">
                          <span class="x-red">*</span>用户名
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="admin_user" name="admin_user" required="" value="<?php echo $conf['admin_user']; ?>" lay-verify="required"
                          autocomplete="off" class="layui-input">
                      </div>
                      
                  </div>
                  <div class="layui-form-item">
                      <label for="phone" class="layui-form-label">
                          <span class="x-red">*</span>联系电话
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="phone" name="phone" required="" value="<?php echo $conf['phone']; ?>" lay-verify="phone"
                          autocomplete="off" class="layui-input">
                      </div>
                      
                  </div>
                  <div class="layui-form-item">
                      <label for="L_email" class="layui-form-label">
                          <span class="x-red">*</span>QQ邮箱
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="L_email" name="email" required="" value="<?php echo $conf['email']; ?>" lay-verify="email"
                          autocomplete="off" class="layui-input">
                      </div>
                      
                  </div>
              
                  <div class="layui-form-item">
                      <label for="L_pass" class="layui-form-label">
                          <span class="x-red">*</span>登入密码
                      </label>
                      <div class="layui-input-inline">
                          <input type="password" id="admin_pwd" name="admin_pwd" required="" lay-verify="pass"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                  
                  <div class="layui-form-item">
                      <label for="L_repass" class="layui-form-label">
                      </label>
                      <button  class="layui-btn"  type="submit" name="submit">
                      编辑账号
                      </button>
                  </div>
              </form>
                        <?php
}
        ?>
            </div>

        </div>
     <!--请勿盗卖酷享云支付源码程序 ，如发现盗卖将不提供更新服务，系统由余生网络信息提供技术服务-->
 

   
        <script>layui.use(['form', 'layer'],
            function() {
                $ = layui.jquery;
                var form = layui.form,
                layer = layui.layer;

                //自定义验证规则
                form.verify({
                    nikename: function(value) {
                        if (value.length < 5) {
                            return '昵称至少得5个字符啊';
                        }
                    },
                    pass: [/(.+){6,12}$/, '密码必须6到12位'],
                    repass: function(value) {
                        if ($('#L_pass').val() != $('#L_repass').val()) {
                            return '两次密码不一致';
                        }
                    }
                });

              
          }
      </script>
</body>
</html>
 
      

